package com.pikaqiu.warehouse.domain.dto;

import com.pikaqiu.warehouse.domain.entity.Customer;
import com.pikaqiu.warehouse.domain.entity.Employee;
import com.pikaqiu.warehouse.domain.entity.Supplier;
import com.pikaqiu.warehouse.utils.StringUtils;
import lombok.Data;

/**
 * @Author: Administrator
 * @Date: 2024/8/16
 */
@Data
public class SpecialUserDto {

    private Integer id;
    private String name;
    private String linkPhone;
    private String linkUser;
    private String linkAddress;
    private Integer status;
    private String image;

    public SpecialUserDto(Supplier supplier) {
        this.id = supplier.getId();
        this.name = supplier.getName();
        this.linkPhone = StringUtils.desensitizePhone(supplier.getLinkPhone());
        this.linkUser = StringUtils.desensitizeName(supplier.getLinkUser());
        this.linkAddress = StringUtils.desensitizeAddress(supplier.getLinkAddress());
        this.status = supplier.getStatus();
        this.image = supplier.getImage();
    }

    public SpecialUserDto(Customer customer) {
        this.id = customer.getId();
        this.name = customer.getName();
        this.linkPhone = StringUtils.desensitizePhone(customer.getLinkPhone());
        this.linkUser = StringUtils.desensitizeName(customer.getLinkUser());
        this.linkAddress = StringUtils.desensitizeAddress(customer.getLinkAddress());
        this.status = customer.getStatus();
        this.image = customer.getImage();
    }

    public SpecialUserDto(Employee employee) {
        this.id = employee.getId();
        this.name = employee.getName();
        this.linkPhone = StringUtils.desensitizePhone(employee.getLinkPhone());
        this.linkUser = StringUtils.desensitizeName(employee.getLinkUser());
        this.linkAddress = StringUtils.desensitizeAddress(employee.getLinkAddress());
        this.status = employee.getStatus();
        this.image = employee.getImage();
    }
}
